
let studentsModel = require('./model/studentsModel')

loginController = async (userNumber, passwd) => {
    let result = await studentsModel.findOne({ userNumber, passwd })
    return result;
}

registerController = async (userNumber, passwd,name, gender, age) => {
    let results = await studentsModel.create({ userNumber, passwd ,name, gender, age ,state:"待审核"})
    return {
        results
    }
}

userFindByIdController = async (userNumber) => {
    let results = await studentsModel.findOne({ userNumber })
    return {
        results
    }
}

userState = async (userNumber) => {
    let results = await studentsModel.findOne({ userNumber,state:"通过" })
    return {
        results
    }
}

module.exports = {
    loginController,
    registerController,
    userFindByIdController,
    userState
}